A computing system includes multiple components such as a processor, a memory, and an input/output (I/O) device. Typically, an operating system (OS) manages access to the various components to prevent problems. For example, the memory can experience the problem of having two requests arrive at the same time. Accordingly, the OS schedules multiple requests for the same component to prevent such a problem.
Similar to applications requesting access to components, the components may request access to other components, such as the processor requesting access to the memory. The OS also schedules these requests. However, some components, such as the I/O device, can directly access a component such as the memory, without making a request to the OS. For example, an I/O device can use a direct memory access (DMA) channel to transmit requests to the memory. By not using the processor as an intermediary, operations between the memory and the I/O device can happen faster than if the OS mediated access.
However, there are instances when data in one location in the memory should be relocated to another location. For example, the memory may become fragmented and access to and from the memory slows to unacceptable performance levels. A typical solution is to move the data from a source location to a destination location in the memory. Moreover, some locations in memory may become unreliable and the data in those locations must be moved to prevent data loss. In such instances, the OS moves data in the unreliable memory locations to reliable memory locations.
Unfortunately, some data cannot be moved without placing the OS in a coma-like state. In the coma-like state, the OS ceases operation and overall computing system performance decreases because the OS is not scheduling requests. Further, during the coma-like state, the OS prevents access to the memory by applications and components, such as the processor. However, the OS cannot prevent access to the memory by the I/O device because some components, such as the I/O device, can bypass the OS when accessing the memory. Accordingly, because the OS cannot prevent access to the memory by the I/O device during the data relocation, erroneous information can be disseminated in the computing system.
A simple solution to this problem is to have each and every component including the I/O device transmit all memory requests to the OS. However, this will tremendously decrease the overall performance of the system because access to and from memory via the DMA channel is faster than OS based memory requests.
Accordingly, what is needed is a method and an apparatus for mapping accesses to the memory that bypass transmitting requests to the OS for memory access while maintaining current computing system performance.